<template>
  <div>
    <van-nav-bar
      title="添加地址"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="content">
      <van-address-edit
        :area-list="area"
        show-postal
        show-set-default
        :area-columns-placeholder="['请选择', '请选择', '请选择']"
        @save="onSave"
      />
    </div>
  </div>
</template>

<script>
import area from '@utils/area'
import { Toast } from 'vant'
export default {
  name: 'contactAdd',
  data () {
    return {
      area
    }
  },
  methods: {
    onClickLeft () {
      this.$router.replace('contactlist')
    },
    onSave (item) {
      this.$store.commit('Address/add_address', item)
      this.$toast('添加成功')
      this.$router.replace('contactlist')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
